import java.awt.HeadlessException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class Index extends JFrame{
    
   JFrame frame=new JFrame("Main Page");
   JDesktopPane pane=new JDesktopPane();
   JLabel tit=new JLabel();
   JPanel photo=new JPanel();
   JButton newent=new JButton();
   JButton chain=new JButton();
   JButton exit=new JButton();
   JButton member=new JButton();

    public Index() throws HeadlessException {
     frame.setLocation(150, 30);
        frame.setVisible(true);
        frame.setSize(500, 400);
        frame.setResizable(false);
        frame.add(pane);
        pane.setBounds(0,0,500, 400);
        pane.setBackground(new java.awt.Color(0, 255, 153));
        
        pane.add(tit);
        tit.setBounds(155, 0, 240, 40);
        tit.setFont(new java.awt.Font("Arial Rounded MT Bold", 1, 18)); // NOI18N
        tit.setForeground(new java.awt.Color(255, 102, 102));
        tit.setText("MAHAVIR MOTORS");
        
        pane.add(photo);
        photo.setBounds(150, 120, 190, 190);
        
        pane.add(newent);
        newent.setBounds(20,167 , 100, 30);
        newent.setText("New Entry");
        
        pane.add(member);
        member.setBounds(20,263, 100, 30);
        member.setText("Member");
        
        pane.add(chain);
        chain.setBounds(360, 167, 100, 30);
        chain.setText("Chain view");
        
        pane.add(exit);
        exit.setBounds(360, 263, 100, 30);
        exit.setText("Exit");
        
        
        
       newent.addActionListener(new ActionListener(){

           @Override
           public void actionPerformed(ActionEvent e) {
        	   new ChainRegistration();
                     
           }
       });
       member.addActionListener(new ActionListener(){

           @Override
           public void actionPerformed(ActionEvent e) {
        	   try {
				new ClientDetails();
			} catch (Exception e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
                     
           }
       });
       exit.addActionListener(new ActionListener(){

           @Override
           public void actionPerformed(ActionEvent e) {
        	   frame.dispose();
           }
       });
          
    
    }
    
    
    public static void main(String args[]){
        new Index();
    }
    
}
